#ifndef DISCOUNTCURVE_H
#define DISCOUNTCURVE_H

#include <string>
#include <map>
#include "Date.h"
#include "DayCounter.h"

using namespace std;

typedef map<Date, double> ValuePair;
typedef ValuePair::iterator ValuePairIter;
typedef ValuePair::const_iterator ValuePairConstIter;
typedef map<double, double> DiscountFunc;
typedef DiscountFunc::iterator DiscountFuncIter;
typedef DiscountFunc::const_iterator DiscountFuncConstIter;

class DiscountCurve
{
public:
  DiscountCurve(string, const DayCounter&);
  virtual ~DiscountCurve();
  virtual double getRate(const Date&) const = 0;

protected:
  ValuePair inputValues_;
  DiscountFunc discountFunction_;
  DayCounter* dayCounter_;
  Date startDate_;
};

class DiscountCurveConstant : public DiscountCurve {
public:
  DiscountCurveConstant(string, const DayCounter&);
  ~DiscountCurveConstant();
  double getRate(const Date&) const;
};

class DiscountCurveLinear : public DiscountCurve {
public:
  DiscountCurveLinear(string, const DayCounter&);
  ~DiscountCurveLinear();
  double getRate(const Date&) const;
};

class DiscountCurveSpline : public DiscountCurve {
};

#endif // DISCOUNTCURVE_H
